Skip to main content

Numeric

EOSIO Javascript / Exports / Numeric

Namespace: Numeric

Table of contents

Enumerations

Interfaces

Variables

Functions

Variables

privateKeyDataSize

Const privateKeyDataSize: 32

Private key data size, excluding type field

Defined in

src/eosjs-numeric.ts:273


publicKeyDataSize

Const publicKeyDataSize: 33

Public key data size, excluding type field

Defined in

src/eosjs-numeric.ts:270


signatureDataSize

Const signatureDataSize: 65

Signature data size, excluding type field

Defined in

src/eosjs-numeric.ts:276

Functions

base58ToBinary

base58ToBinary(size, s): Uint8Array

Convert an unsigned base-58 number in s to a bignum

Parameters

NameTypeDescription
sizenumberbignum size (bytes)
sstring-

Returns

Uint8Array

Defined in

src/eosjs-numeric.ts:173


base64ToBinary

base64ToBinary(s): Uint8Array

Convert an unsigned base-64 number in s to a bignum

Parameters

NameType
sstring

Returns

Uint8Array

Defined in

src/eosjs-numeric.ts:227


binaryToBase58

binaryToBase58(bignum, minDigits?): string

Convert bignum to a base-58 number

Parameters

NameTypeDefault valueDescription
bignumUint8Arrayundefined-
minDigitsnumber10-pad result to this many digits

Returns

string

Defined in

src/eosjs-numeric.ts:201


binaryToDecimal

binaryToDecimal(bignum, minDigits?): string

Convert bignum to an unsigned decimal number

Parameters

NameTypeDefault valueDescription
bignumUint8Arrayundefined-
minDigitsnumber10-pad result to this many digits

Returns

string

Defined in

src/eosjs-numeric.ts:109


convertLegacyPublicKey

convertLegacyPublicKey(s): string

If a key is in the legacy format (EOS prefix), then convert it to the new format (PUB_K1_). Leaves other formats untouched

Parameters

NameType
sstring

Returns

string

Defined in

src/eosjs-numeric.ts:373


convertLegacyPublicKeys

convertLegacyPublicKeys(keys): string[]

If a key is in the legacy format (EOS prefix), then convert it to the new format (PUB_K1_). Leaves other formats untouched

Parameters

NameType
keysstring[]

Returns

string[]

Defined in

src/eosjs-numeric.ts:383


decimalToBinary

decimalToBinary(size, s): Uint8Array

Convert an unsigned decimal number in s to a bignum

Parameters

NameTypeDescription
sizenumberbignum size (bytes)
sstring-

Returns

Uint8Array

Defined in

src/eosjs-numeric.ts:62


isNegative

isNegative(bignum): boolean

Is bignum a negative number?

Parameters

NameType
bignumUint8Array

Returns

boolean

Defined in

src/eosjs-numeric.ts:43


negate

negate(bignum): void

Negate bignum

Parameters

NameType
bignumUint8Array

Returns

void

Defined in

src/eosjs-numeric.ts:48


privateKeyToLegacyString

privateKeyToLegacyString(key): string

Convert private key to legacy string (base-58) form

Parameters

NameType
keyKey

Returns

string

Defined in

src/eosjs-numeric.ts:413


privateKeyToString

privateKeyToString(key): string

Convert key to string (base-58) form

Parameters

NameType
keyKey

Returns

string

Defined in

src/eosjs-numeric.ts:440


publicKeyToLegacyString

publicKeyToLegacyString(key): string

Convert public key to legacy string (base-58) form

Parameters

NameType
keyKey

Returns

string

Defined in

src/eosjs-numeric.ts:347


publicKeyToString

publicKeyToString(key): string

Convert key to string (base-58) form

Parameters

NameType
keyKey

Returns

string

Defined in

src/eosjs-numeric.ts:358


signatureToString

signatureToString(signature): string

Convert signature to string (base-58) form

Parameters

NameType
signatureKey

Returns

string

Defined in

src/eosjs-numeric.ts:467


signedBinaryToDecimal

signedBinaryToDecimal(bignum, minDigits?): string

Convert bignum to a signed decimal number

Parameters

NameTypeDefault valueDescription
bignumUint8Arrayundefined-
minDigitsnumber10-pad result to this many digits

Returns

string

Defined in

src/eosjs-numeric.ts:132


signedDecimalToBinary

signedDecimalToBinary(size, s): Uint8Array

Convert a signed decimal number in s to a bignum

Parameters

NameTypeDescription
sizenumberbignum size (bytes)
sstring-

Returns

Uint8Array

Defined in

src/eosjs-numeric.ts:87


stringToPrivateKey

stringToPrivateKey(s): Key

Convert key in s to binary form

Parameters

NameType
sstring

Returns

Key

Defined in

src/eosjs-numeric.ts:388


stringToPublicKey

stringToPublicKey(s): Key

Convert key in s to binary form

Parameters

NameType
sstring

Returns

Key

Defined in

src/eosjs-numeric.ts:319


stringToSignature

stringToSignature(s): Key

Convert key in s to binary form

Parameters

NameType
sstring

Returns

Key

Defined in

src/eosjs-numeric.ts:451